#include "stdafx.h"
#include "Sort.h"

int** sort(int** A, int size_A,int line)
{
	int** B = NULL;
	int tmp;
	//B = A;
	B = new int*[size_A];
	for (int i = 0; i < size_A; i++)
	{
		B[i] = new int[size_A];
		for (int j = 0; j < size_A; j++)
		{
			B[i][j] = A[i][j];
		}
	}

	for (int i = 0; i <= size_A*size_A; i++)
		for (int j = 0; j < size_A; j++)
			for (int k = 0; k < size_A - 1; k++)
			{
				if (j == line-1)
					if (B[j][k] > B[j][k + 1])
					{
						tmp = B[j][k];
						B[j][k] = B[j][k + 1];
						B[j][k + 1] = tmp;
					}
			}
	return B;
}